package com.example.backend.service.mysql.classify.impl;

import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.backend.entitly.mysql.classify.Categories;
import com.example.backend.mapper.mysql.classify.CategoriesMapper;
import com.example.backend.service.mysql.classify.CategoriesService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 1
 * @description 针对表【categories(商品分类表)】的数据库操作Service实现
 * @createDate 2025-06-04 09:01:51
 */
@Service
public class CategoriesServiceImpl extends ServiceImpl<CategoriesMapper, Categories>
        implements CategoriesService {

    @Override
    public List<Categories> getChildrenByParentId(Integer categoryId) {
        return new LambdaQueryChainWrapper<>(getBaseMapper())
                .eq(Categories::getParentId, categoryId)
                .list();
    }
}




